package com.hzsai.controller;

import com.hzsai.service.FilmService;
import com.hzsai.utils.ResultMsg;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * hzsai
 * 2019/8/20 18:15
 * usage:
 */
@Api(tags = "Film")
@RestController
@RequestMapping("/film")
public class FilmConstroller {

    @Autowired
    private FilmService service;

    @ApiOperation(value = "根据id查名字")
    @GetMapping("/name/{id}")
    public ResultMsg findById(@PathVariable Integer id) {
        return ResultMsg.success(service.findById(id));
    }
}
